package com.dlmap.readbook.views;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;



public class WebSiteDialog extends Dialog {
	private Text text;
	private Label label;
	
	private String message = "";
	
	public WebSiteDialog(Shell parent) {
		super(parent);
	}
	
	
	protected Control createDialogArea(Composite parent) {
		Composite container = (Composite) super.createDialogArea(parent);
		container.setLayout(new RowLayout());
		label = new Label(container, SWT.BORDER);
		label.setText("URL: ");
		text = new Text(container, SWT.BORDER);
		text.setLayoutData(new RowData(200,-1));
		return container;
	}
	
	protected void okPressed()
	{
		message = this.text.getText();
		super.okPressed();
	}
	
	public String getInputText(){
		return message;
	}
	
//	protected int getShellStyle(){
//		return super.getShellStyle()|SWT.RESIZE|SWT.MAX;
//	}
//	protected Point getInitialSize(){
//		return new Point(300,80);
//	}

}
